<?php 
// var_dump($_GET);
// var_dump($_POST);
var_dump($_FILES);
exit;
// 文件没有上传到
if(empty($_FILES)){
	exit("files  empty");
}

$data = current($_FILES);

var_dump($data);

//上传有错误
if($data['error']){
	exit("upload  erro,error_num:".$data['error']);
}

//上传类型的限制
$type = ['image/png','image/jpeg','image/gif'];

if(!in_array($data['type'], $type)){
	exit("type error,allow type:".implode(',', $type));
}


//上传大小限制
if($data['size']>200*1024){
	exit("size error,allow size:100k");
}

//移动文件到目标地址

$name = uniqid().md5('xbs');

$suffux = explode('.', $data['name']);

$suffux = end($suffux);

$path = $name.'.'.$suffux;

move_uploaded_file($data['tmp_name'], './Upload/'.$path);




 ?>